package com.mayikt.days04;

/**
 * @ClassName Test005
 * @Author 蚂蚁课堂余胜军 QQ644064779 www.mayikt.com
 * @Version V1.0
 **/
public class Test005 {
    static class Thread0040Callable implements MyCallable<String> {
        @Override
        public String call() {
            try {
                Thread.sleep(3000);
            } catch (Exception e) {

            }
            System.out.println(Thread.currentThread().getName() + ",已结发送短信成功");
            return "mayikt";
        }
    }

    public static void main(String[] args) {
        MyTask<String> stringMyTask = new MyTask<>(new Thread0040Callable());
        new Thread(stringMyTask).start();
        String s = stringMyTask.get();
        System.out.println(s);
    }
}
